home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / swtools / mipsABI / examples / sup / PORT / step06 / supscan.c.diff < prev    next >
Encoding:
Text File  |  1994-08-02  |  1.4 KB  |  70 lines

  1. *** ../dist/supscan.c    Thu Dec 16 07:30:01 1993
  2. --- supscan.c    Fri Dec 17 12:10:19 1993
  3. ***************
  4. *** 124,129 ****
  5. --- 124,132 ----
  6.   #endif
  7.   #include <sys/time.h>
  8.   #include <sys/types.h>
  9. + #ifdef _ABI_SOURCE
  10. + #include <sys/utsname.h>
  11. + #endif
  12.   #include "sup.h"
  13.   
  14.   #ifdef    lint
  15. ***************
  16. *** 391,400 ****
  17. --- 394,419 ----
  18.   int localhost (host)
  19.   register char *host;
  20.   {
  21. + #ifdef _ABI_SOURCE
  22. +     static struct utsname myhost;
  23. + #else
  24.       static char myhost[STRINGLENGTH];
  25. + #endif
  26.       static int myhostlen;
  27.       register int hostlen;
  28.   
  29. + #ifdef _ABI_SOURCE
  30. +     if (*(myhost.nodename) == '\0') {
  31. +         /*
  32. +          * We assume that the host name in the kernel is the
  33. +          * fully qualified form.
  34. +          */
  35. +         if (uname (&myhost) < 0) {
  36. +             quit (1,"supscan: can't get kernel host name\n");
  37. +         }
  38. +         myhostlen = strlen(myhost.nodename);
  39. +     }
  40. + #else
  41.       if (*myhost == '\0') {
  42.           /*
  43.            * We assume that the host name in the kernel is the
  44. ***************
  45. *** 405,410 ****
  46. --- 424,430 ----
  47.           }
  48.           myhostlen = strlen(myhost);
  49.       }
  50. + #endif
  51.   
  52.       /*
  53.        * Here, we assume that the 'host' parameter from the
  54. ***************
  55. *** 419,425 ****
  56. --- 439,451 ----
  57.   
  58.       hostlen = strlen(host);
  59.   
  60. + #ifdef _ABI_SOURCE
  61. +     return(strncasecmp (myhost.nodename,
  62. +                 host,
  63. +                 hostlen < myhostlen ? hostlen : myhostlen) == 0);
  64. + #else
  65.       return(strncasecmp (myhost,
  66.                   host,
  67.                   hostlen < myhostlen ? hostlen : myhostlen) == 0);
  68. + #endif
  69.   }
  70.